<?php echo $this->Html->css('hProducts') ?>

<?php // debug($lineSales)   ?>

<div class="lineSales view">

    <h2><?php echo __('Detalle de Venta'); ?></h2>

    <table cellpadding="0" cellspacing="0">
        <tr>
            <th><?php echo 'Promocion' ?></th>
            <th><?php echo 'Cantidad' ?></th>
            <th><?php echo 'Total de Linea ($)' ?></th>
            <th><?php echo 'CashId' ?></th>
            <th class="actions"><?php echo __('Opciones'); ?></th>
        </tr>
        <?php $totalSuma = 0; ?>
        <?php foreach ($lineSales as $lineSale): ?>
            <tr>
                <td>
                    <?php echo $this->Html->link($lineSale['Promotion']['name'], array('controller' => 'promotions', 'action' => 'view', $lineSale['Promotion']['id'])); ?>
                </td>
                <td><?php echo h($lineSale['LineSale']['quantity']); ?>&nbsp;</td>
                <td><?php echo h($lineSale['LineSale']['total_line']); ?>&nbsp;</td>
                <?php $totalSuma += $lineSale['LineSale']['total_line']; ?>

                <td><?php echo h($lineSale['LineSale']['cash_dailies_id']); ?>&nbsp;</td>

                <td class="actions">
                    <?php echo $this->Form->postLink(__('Borrar Linea'), array('action' => 'delete', $lineSale['LineSale']['id'], $lineSale['LineSale']['promotion_id'], $lineSale['LineSale']['quantity'], $lineSale['Sale']['shop_id']), null, __('¿Realmente desea eliminar la venta?', $lineSale['LineSale']['id'])); ?>
                </td>
            </tr>

        <?php endforeach; ?>
        <tfoot>
            <tr >
                <th></th>
                <th></th>
                <th>Total :</th>
                <th class="total">  <?php echo $totalSuma ?></th>
                <th></th>

            </tr>
        </tfoot>
    </table>

</div>
<!--Show General Menu-->
<?php echo $this->element('menues/general') ?>
